package org.fuxian.dao;

import org.apache.ibatis.annotations.*;
import org.fuxian.domain.MyArea;

import java.util.List;

public interface MyAreaMapper {
    @Select("select * from myarea where aid = #{aid}")
    public MyArea findById(int sid);

    @Select("select * from myarea where aname = #{aname}")
    public MyArea findByName(String aname);

    @Insert("insert into myarea values(null, #{aname})")
    public int add(String sname);

    @Update("update myarea set aname = #{aname} where aid = #{aid}")
    public int update(@Param("aname") String aname, @Param("aid") int aid);

    @Select("select * from myarea")
    public List<MyArea> findAll();

    @Delete("DELETE FROM myarea WHERE aid=#{aid}")
    public int delete(@Param("aid") int aid);
}
